package com.wiz.common.util;

import com.wiz.web.vo.type.MemberOperationType;
import com.wiz.web.vo.type.MemberStatusType;

/**
 * 判断会员权限工具类
 * @author xdzheng@wiz-tech.com.cn
 * @version 创建时间: 2016年4月7日 下午6:35:35
 */
public class MemberPermissionUtil {

	/**
	 * 
	 * @param memberOperationType 操作类typeId
	 * @param memberStatus 会员状态
	 * @return true：允许操作，false：禁止操作
	 */
    public static boolean check(int memberOperationType, int memberStatus){
    	if(memberStatus==MemberStatusType.NORMAL.getId()&&MemberOperationType.UNFROZEN.getId()!=memberOperationType)
    		return true;
        if(memberStatus==MemberStatusType.FROZEN.getId())
        	if(memberOperationType==MemberOperationType.SELECT.getId()
        	||memberOperationType==MemberOperationType.UPDATE.getId()
        	||memberOperationType==MemberOperationType.UNFROZEN.getId()
        	||memberOperationType==MemberOperationType.CLOSE.getId())
        		return true;
        if(memberOperationType==MemberStatusType.CANCEL.getId()&&MemberOperationType.SELECT.getId()==memberOperationType)
        	return true;
        return false;    
    }

}